home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / RG4WCR (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.4 KB  |  37 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.AbstractAction;
  4. import java.awt.event.ActionEvent;
  5. import java.io.Serializable;
  6.  
  7. class BasicTreeUI$TreeHomeAction extends AbstractAction implements Serializable {
  8.    // $FF: synthetic field
  9.    BasicTreeUI this$0;
  10.    private int direction;
  11.  
  12.    // $FF: synthetic method
  13.    public BasicTreeUI$TreeHomeAction(BasicTreeUI this$0, int direction, String name) {
  14.       super(name);
  15.       this.this$0 = this$0;
  16.       this.direction = direction;
  17.    }
  18.  
  19.    public void actionPerformed(ActionEvent e) {
  20.       int rowCount = this.this$0.getRowCount();
  21.       if (this.this$0.tree != null && rowCount > 0) {
  22.          if (this.direction == -1) {
  23.             this.this$0.ensureRowsAreVisible(0, 0);
  24.             this.this$0.tree.setSelectionInterval(0, 0);
  25.          } else {
  26.             this.this$0.ensureRowsAreVisible(rowCount - 1, rowCount - 1);
  27.             this.this$0.tree.setSelectionInterval(rowCount - 1, rowCount - 1);
  28.          }
  29.       }
  30.  
  31.    }
  32.  
  33.    public boolean isEnabled() {
  34.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  35.    }
  36. }
  37.